<template>
  <div>
    <a-table :columns="columns" :dataSource="dataSource" rowKey="id" :pagination="false">
      <template #view="record">
        <span>浏览了{{ record.hotel }}酒店的{{ record.hall }}的宴会厅</span>
      </template>
    </a-table>
    <my-pagination :total="total" :payload="payload"></my-pagination>
  </div>
</template>

<script>
import * as Api from "@/api/userMag.js";
// import MyPagination from '@/common/myPagination'
export default {
  data() {
    const { id = "", page = "1", per_page = "12" } = this.$route.query;
    return {
      payload: {
        id,
        page: Number(page),
        per_page: Number(per_page)
      },
      total: 0,
      columns: [
        { title: "提交时间", dataIndex: "created_at" },
        { title: "浏览记录", scopedSlots: { customRender: "view" } }
      ],
      dataSource: []
    };
  },
  mounted() {
    this.fetchList();
  },
  methods: {
    async fetchList() {
      const { view } = await Api.historyList(this.payload);
      this.total = view.total;
      this.dataSource = view.list;
    }
  }
};
</script>

<style></style>
